(function (aH, aN) {
    var aq = new Date();
    var l;
    var W;
    var ar;
    var ah;
    var z;
    var aR;
    var p;
    var aW;
    var M;
    var au;
    var ay;
    var a1;
    var aV;
    var x;
    var G;
    var aM;
    var ag;
    var U;
    var y;
    var Y;
    var af;
    var aj;
    var aO;
    var at;
    var an;
    var O;
    var aX;
    var av;
    var f = true;
    var a3 = true;
    var aI = [];
    var ak = [];
    var q = [];
    var Z = [];
    var aJ = [];
    var aG = 1;
    var aY = 1;
    var K = 1;
    var H = false;
    var aL = 1;
    var a2 = false;
    var n;
    var o = 500;
    var X = 0;
    var e = 0;
    var ao = false;
    var ap = [];
    var am = [];
    var V = [];
    var aF = 0;
    var r = 0;
    var a0 = 0;
    var L = 0;
    var ai;
    var C;
    var J, aK = [], E;
    var aS = [];
    var w = [];
    var g = [];
    var S = [];
    var j = [];
    var aU = new AMap.InfoWindow({offset: new AMap.Pixel(0, -10), closeWhenClickMap: true});
    var aQ = new AMap.InfoWindow({offset: new AMap.Pixel(0, -10), closeWhenClickMap: true});
    var aP = new AMap.InfoWindow({offset: new AMap.Pixel(0, -10), closeWhenClickMap: true});
    var m = false;
    var ax;
    var T = 1;
    var I;
    var Q;
    var aA;
    var aE;
    var P = [];
    var aa = [];
    var u = true;
    var ad = true;
    var v = true;
    var h;
    var B;
    var aB;
    var az;
    var b;
    var t;
    var ae;
    var aC;
    var k;
    var ab = false;
    var s = [];
    var aD = [];
    var N;
    var a;
    var d;
    var aZ;
    var R;
    var aw;
    var F;
    var al;
    var c;
    var D;
    var aT;
    var ac;
    var A;
    trackPlayback = {
        init: function () {
            aH(aN).resize(function () {
                var a6 = aH(aN).width();
                if (a6 < 1200) {
                    aH("body").css("overflow", "auto");
                } else {
                    aH("body").css("overflow", "hidden");
                }
            });
            ar = aq.getFullYear() + "-" + (parseInt(aq.getMonth() + 1) < 10 ? "0" + parseInt(aq.getMonth() + 1) : parseInt(aq.getMonth() + 1)) + "-01";
            ah = aq.getFullYear() + "-" + (parseInt(aq.getMonth() + 2) < 10 ? "0" + parseInt(aq.getMonth() + 2) : parseInt(aq.getMonth() + 2)) + "-01";
            z = aq.getFullYear() + "-" + (parseInt(aq.getMonth() + 1) < 10 ? "0" + parseInt(aq.getMonth() + 1) : parseInt(aq.getMonth() + 1)) + "-" + (aq.getDate() < 10 ? "0" + aq.getDate() : aq.getDate()) + " " + "00:00:00";
            aR = aq.getFullYear() + "-" + (parseInt(aq.getMonth() + 1) < 10 ? "0" + parseInt(aq.getMonth() + 1) : parseInt(aq.getMonth() + 1)) + "-" + (aq.getDate() < 10 ? "0" + aq.getDate() : aq.getDate()) + " " + ("23") + ":" + ("59") + ":" + ("59");
            aH("#startTime").val(z);
            aH("#endTime").val(aR);
            p = aH("#header .brand").width();
            aW = aH("#header .toggle-navigation").width();
            M = aH(aN).width();
            au = (p + aW + 40 + 2) / M * 100;
            aH("#content-left").css({"width": au + "%"});
            aH("#content-right").css({"width": 100 - au + "%"});
            aH(".sidebar").attr("class", "sidebar sidebar-toggle");
            aH(".main-content-wrapper").attr("class", "main-content-wrapper main-content-toggle-left");
            ay = aH(aN).height();
            a1 = aH("#header").height();
            aV = aH(".panel-heading").height() + 20;
            x = aH("#citySel").parent().height();
            G = aH(".realTimeCanArea").height() + 13;
            aH(".calendar3").calendar();
            aM = aH(".calendar3 tbody tr").length;
            if (aM == 5) {
                ag = 295;
            } else {
                if (aM == 4) {
                    ag = 350;
                } else {
                    if (aM == 6) {
                        ag = 340;
                    }
                }
            }
            U = ay - a1 - aV - ag - x - G;
            aH("#treeDemo").css("height", U + "px");
            if (ay <= 667) {
                aH("#treeDemo").css("height", 110 + "px");
            }
            y = aH(".panHeadHeight").height() + 30;
            Y = aH("#Demo").height();
            af = initialMapH = ay - a1 - y - Y - 20;
            aH("#operationMenu").css("height", ay - a1 + "px");
            aH(".sidebar").css("height", ay - a1 + "px");
            aH("#MapContainer").css({"height": af + "px"});
            aj = aH("#operationMenu").height();
            aO = ay - a1;
            aH("#operationMenu").css({"height": aO + "px"});
            an = aH("#MapContainer").height();
            O = aH("#myTab").height();
            aX = aH(aN).height();
            map = new AMap.Map("MapContainer", {resizeEnable: true, scrollWheel: true, zoom: 18});
            var a5 = map.on("dragend", trackPlayback.clickEventListener2);
            b = new AMap.MouseTool(map);
            b.on("draw", trackPlayback.createSuccess);
            az = new AMap.Buildings();
            az.setMap(map);
            map.getCity(function (a6) {
                var a7 = "" + a6.province + '<span class="caret"></span>';
                aH("#placeChoose").html(a7);
            });
            AMap.plugin(["AMap.ToolBar", "AMap.Scale"], function () {
                map.addControl(new AMap.ToolBar({"direction": false,}));
                map.addControl(new AMap.Scale());
            });
            t = new AMap.TileLayer.Satellite();
            t.setMap(map);
            t.hide();
            ae = new AMap.TileLayer.Traffic();
            ae.setMap(map);
            ae.hide();
            aH(".amap-logo").attr("href", "javascript:void(0)").attr("target", "");
            MarkerMovingControl = function (a8, a6, a7) {
                this._map = a8;
                this._marker = a6;
                this._path = a7;
                this._currentIndex = 0;
                a6.setMap(a8);
                a6.setPosition(a7[0]);
            };
            MarkerMovingControl.prototype.move = function () {
                if (!this._listenToStepend) {
                    this._listenToStepend = AMap.event.addListener(this, "stepend", function () {
                        this.step();
                    }, this);
                }
                this.step();
            };
            MarkerMovingControl.prototype.stop = function () {
                this._marker.stopMove();
            };
            MarkerMovingControl.prototype.restart = function () {
                this._marker.setPosition(this._path[0]);
                this._currentIndex = 0;
                this.stop();
            };
            MarkerMovingControl.prototype.retreat = function () {
                if (aL < 2) {
                    this._marker.setPosition(this._path[aL - 1]);
                    this._currentIndex = aL - 1;
                    this.move();
                } else {
                    this._marker.setPosition(this._path[aL - 2]);
                    this._currentIndex = aL - 2;
                    if (T == 0) {
                        this.move();
                    } else {
                        if (T == 1) {
                            this.move();
                            this.stop();
                        }
                    }
                }
            };
            MarkerMovingControl.prototype.FF = function () {
                var a6 = this._path.length;
                if (aL < a6) {
                    this._marker.setPosition(this._path[aL]);
                    this._currentIndex = aL;
                    if (T == 0) {
                        this.move();
                    } else {
                        if (T == 1) {
                            this.move();
                            this.stop();
                        }
                    }
                } else {
                    layer.msg("这已经是最后一个点了");
                }
            };
            MarkerMovingControl.prototype.skip = function () {
                this._marker.setPosition(this._path[n]);
                this._currentIndex = n;
                if (T == 0) {
                    this.move();
                } else {
                    if (T == 1) {
                        this.move();
                        this.stop();
                    }
                }
                aL = n;
            };
            MarkerMovingControl.prototype.step = function () {
                var bi = this._path.length;
                var be = (100 / bi) * X;
                B.SetValue(be);
                var bc = this._currentIndex + 1;
                if (bc <= this._path.length) {
                    if (!this._listenToMoveend) {
                        this._listenToMoveend = AMap.event.addListener(this._marker, "moveend", function () {
                            this._currentIndex++;
                            AMap.event.trigger(this, "stepend");
                        }, this);
                    }
                    aL = bc;
                    if (L != bc) {
                        L = bc;
                        aH("#gpsTable tbody tr").removeClass("tableSelected");
                        if (a2) {
                            e = e - 1;
                            a2 = false;
                        }
                        if (m) {
                            e--;
                            X--;
                            if (e < 1) {
                                e = 0;
                            }
                            if (X < 1) {
                                X = 1;
                            }
                            var bb = (aH("#gpsTable tbody tr:first-child").height()) * e;
                            aH("#gpsTable tbody tr:nth-child(" + X + ")").addClass("tableSelected");
                            aH("#GPSData .dataTables_scrollBody").scrollTop(bb);
                            m = false;
                        } else {
                            X++;
                            aH("#gpsTable tbody tr:nth-child(" + X + ")").addClass("tableSelected");
                            if (X >= 5) {
                                e++;
                                var bb = (aH("#gpsTable tbody tr:first-child").height()) * e;
                                aH("#GPSData .dataTables_scrollBody").scrollTop(bb);
                            }
                        }
                    }
                    if (this._path[bc] != undefined) {
                        this._marker.moveTo(this._path[bc], o);
                        AMap.event.addListener(J, "moving", function () {
                            var bp = J.getPosition();
                            if (E.contains(bp) != true) {
                                map.panTo(bp);
                                var bn = map.getBounds().getSouthWest();
                                var bm = map.getBounds().getNorthEast();
                                var bk = bn.lat;
                                var bo = bn.lng;
                                var bl = bm.lat;
                                var bq = bm.lng;
                                E = new AMap.Bounds([bo, bk], [bq, bl]);
                            }
                        });
                    }
                }
                if (V[aL - 1] > 0) {
                    aF = (V[aL - 1] - V[0]).toFixed(2);
                    aH("#allMileage").text(aF + "km");
                }
                var bd = am[0];
                var bg = am[aL - 1];
                var a7 = (new Date(bg.replace(/-/g, "/"))).getTime();
                var bh = (new Date(bd.replace(/-/g, "/"))).getTime();
                var ba = (a7 - bh);
                var bf = parseInt(ba / 1000);
                var a9 = 0;
                var a8 = 0;
                if (bf > 60) {
                    a9 = parseInt(bf / 60);
                    bf = parseInt(bf % 60);
                    if (a9 > 60) {
                        a8 = parseInt(a9 / 60);
                        a9 = parseInt(a9 % 60);
                    }
                }
                var bj = "" + parseInt(bf) + "秒";
                if (a9 > 0) {
                    bj = "" + parseInt(a9) + "分" + bj;
                }
                if (a8 > 0) {
                    bj = "" + parseInt(a8) + "小时" + bj;
                }
                a0 = bj;
                aH("#allTime").text(a0);
                var a6 = ap.slice(0, aL);
                r = Math.max.apply(null, a6);
                aH("#maxSpeend").text(r + "km/h");
                if (T == 0) {
                }
            };
            ai = map.on("zoomend", function () {
                var a9 = map.getBounds().getSouthWest();
                var a8 = map.getBounds().getNorthEast();
                var a6 = a9.lat;
                var ba = a9.lng;
                var a7 = a8.lat;
                var bb = a8.lng;
                E = new AMap.Bounds([ba, a6], [bb, a7]);
            });
            ax = aH("#MapContainer").height();
            Math.formatFloat = function (a7, a8) {
                var a6 = Math.pow(10, a8);
                return parseInt(a7 * a6, 10) / a6;
            };
            var a4 = {
                async: {
                    url: "/clbs/m/functionconfig/fence/bindfence/vehicelTree",
                    type: "post",
                    enable: true,
                    autoParam: ["id"],
                    dataType: "json",
                    otherParam: {"type": "single"},
                    dataFilter: trackPlayback.ajaxDataFilter
                },
                check: {enable: true, chkStyle: "radio"},
                view: {dblClickExpand: false},
                data: {simpleData: {enable: true}},
                callback: {
                    beforeCheck: trackPlayback.zTreeBeforeCheck,
                    onCheck: trackPlayback.onCheck,
                    beforeClick: trackPlayback.zTreeBeforeClick,
                    onAsyncSuccess: trackPlayback.zTreeOnAsyncSuccess,
                    onClick: trackPlayback.zTreeOnClick
                }
            };
            aH.fn.zTree.init(aH("#treeDemo"), a4, null);
            h = {
                value: 50, maxValue: 40000, step: 1, Initialize: function () {
                    if (this.value > this.maxValue) {
                        layer.msg("给定当前值大于了最大值！", {move: false});
                        return;
                    }
                    this.GetValue();
                    var a6 = 500 / (this.maxValue - 50) * aH("#scrollBar").width();
                    aH("#scroll_Track").css("width", a6 + 2 + "px");
                    aH("#scroll_Thumb").css("margin-left", a6 + "px");
                    this.Value();
                }, Value: function () {
                    if (u) {
                        o = 500;
                        u = false;
                    }
                    var a7 = false;
                    var a6;
                    aH("#scroll_Thumb").mousedown(function () {
                        a7 = true;
                        aH(document.body).mousemove(function (a8) {
                            v = false;
                            if (a7 == false) {
                                return;
                            }
                            a6 = Math.round(a8.clientX) - aH("#Demo").offset().left;
                            if (a6 <= 0) {
                                a6 = 0;
                                h.value = 50;
                            }
                            aH("#scroll_Thumb").css("margin-left", a6 + "px");
                            aH("#scroll_Track").css("width", a6 + 2 + "px");
                            if ((a6 + 15) >= aH("#scrollBar").width()) {
                                aH("#scroll_Thumb").css("margin-left", aH("#scrollBar").width() - 10 + "px");
                                aH("#scroll_Track").css("width", aH("#scrollBar").width() + 2 + "px");
                                h.value = h.maxValue;
                            } else {
                                if (a6 <= 0) {
                                    aH("#scroll_Thumb").css("margin-left", "0px");
                                    aH("#scroll_Track").css("width", "0px");
                                } else {
                                    h.value = Math.round(39950 * (a6 / aH("#scrollBar").width()));
                                }
                            }
                        });
                    });
                    aH(document.body).mouseup(function () {
                        if (ad || v) {
                            o = 500;
                            ad = false;
                        } else {
                            o = h.value;
                        }
                        a7 = false;
                    });
                }, GetValue: function () {
                    this.currentX = 0;
                }
            };
            B = {
                maxValue: 100, value: 0, SetValue: function (a7) {
                    this.value = a7;
                    if (this.value >= this.maxValue) {
                        this.value = this.maxValue;
                    }
                    if (this.value <= 0) {
                        this.value = 0;
                    }
                    var a6 = this.value / this.maxValue * aH("#progressBar").width() + "px";
                    aH("#progressBar_Track").css("width", a6);
                }
            };
            aB = aH(aN).width();
            if (aB < 1200) {
                aH("body").css("overflow", "auto");
                if (aB <= 414) {
                    aH(".sidebar").removeClass("sidebar-toggle");
                    aH(".main-content-wrapper").removeClass("main-content-toggle-left");
                }
            } else {
                aH("body").css("overflow", "hidden");
            }
            aH("[data-toggle='tooltip']").tooltip();
        }, clickEventListener2: function () {
            var a7 = map.getBounds().getSouthWest();
            var a6 = map.getBounds().getNorthEast();
            var a4 = a7.lat;
            var a8 = a7.lng;
            var a5 = a6.lat;
            var a9 = a6.lng;
            E = new AMap.Bounds([a8, a4], [a9, a5]);
        }, mouseMove: function (a8) {
            if (at - a8.clientY > 0) {
                var a9 = at - a8.clientY;
                var a6 = af - a9;
                if (a6 <= 0) {
                    a6 = 0;
                }
                aH("#MapContainer").css({"height": a6 + "px"});
                if (a6 == 0) {
                    return false;
                }
                aH(".trackPlaybackTable .dataTables_scrollBody").css({"height": (av + a9) + "px"});
            } else {
                var a5 = a8.clientY - at;
                var a4 = aH("#myTab").offset().top;
                var a7 = aH(".trackPlaybackTable .dataTables_scrollBody").height();
                if (a7 == 0) {
                    return false;
                } else {
                    if (a4 <= (aX - O)) {
                        var a6 = af + a5;
                        aH("#MapContainer").css({"height": a6 + "px"});
                        aH(".trackPlaybackTable .dataTables_scrollBody").css({"height": (av - a5) + "px"});
                    }
                }
            }
            a8.stopPropagation();
        }, mouseUp: function () {
            aH(document).unbind("mousemove", trackPlayback.mouseMove).unbind("mouseup", trackPlayback.mouseUp);
        }, toggleBtn: function () {
            if (aH(".sidebar").hasClass("sidebar-toggle")) {
                if (aH("#content-left").is(":hidden")) {
                    aH("#content-right").css("width", "100%");
                } else {
                    aH("#content-right").css("width", 100 - au + "%");
                    aH("#content-left").css("width", au + "%");
                }
            } else {
                if (aH("#content-left").is(":hidden")) {
                    aH("#content-right").css("width", "100%");
                } else {
                    aH("#content-right").css("width", (100 - au - 3) + "%");
                    aH("#content-left").css("width", (au + 3) + "%");
                }
            }
        }, mapBtnActive: function () {
            aH("#realTimeBtn .mapBtn").removeClass("map-active");
            aH(this).addClass("map-active");
        }, realTimeRC: function () {
            if (f) {
                ae.show();
                aH("#realTimeRC").addClass("map-active");
                f = false;
            } else {
                ae.hide();
                aH("#realTimeRC").removeClass("map-active");
                f = true;
            }
        }, satelliteMapSwitching: function () {
            if (a3) {
                aH("#setMap").addClass("map-active");
                t.show();
                az.setMap(null);
                a3 = false;
            } else {
                aH("#setMap").removeClass("map-active");
                az.setMap(map);
                t.hide();
                a3 = true;
            }
        }, trackMap: function () {
            if (aK.length > 1) {
                J = new AMap.Marker({
                    map: map,
                    position: aK[0],
                    icon: "../../resources/img/vehicle.png",
                    offset: new AMap.Pixel(-26, -13),
                    zIndex: 99999,
                    autoRotation: true
                });
                var be = new AMap.Polyline({
                    map: map,
                    path: aK,
                    strokeColor: "#3366ff",
                    strokeOpacity: 0.9,
                    strokeWeight: 6,
                    strokeStyle: "solid",
                    showDir: true
                });
                k = new MarkerMovingControl(map, J, aK);
                new AMap.Marker({
                    map: map,
                    position: aK[0],
                    offset: new AMap.Pixel(-16, -43),
                    icon: new AMap.Icon({
                        size: new AMap.Size(40, 40),
                        image: "../../resources/img/start.png",
                        imageOffset: new AMap.Pixel(0, 0)
                    })
                });
                new AMap.Marker({
                    map: map,
                    position: aK[aK.length - 1],
                    offset: new AMap.Pixel(-16, -43),
                    icon: new AMap.Icon({
                        size: new AMap.Size(40, 40),
                        image: "../../resources/img/end.png",
                        imageOffset: new AMap.Pixel(0, 0)
                    })
                });
                AMap.event.addListener(J, "click", function () {
                    var bi = [];
                    bi.push("GPS时间：" + aI[aL - 1][2]);
                    bi.push("在线状态：" + aI[aL - 1][4]);
                    bi.push("ACC状态：" + aI[aL - 1][5]);
                    bi.push("速度(km/h)：" + aI[aL - 1][6]);
                    bi.push("方向：" + aI[aL - 1][7]);
                    bi.push('<a type="button" id="addFence" onclick="trackPlayback.showAddFencePage()" style="cursor:pointer;display:block;margin: 8px 0px 0px 0px;" data-toggle="modal" data-target="#commonWin">轨迹生成路线</a>');
                    content = bi;
                    aC = new AMap.InfoWindow({
                        content: content.join("<br/>"),
                        offset: new AMap.Pixel(-20, -13),
                        closeWhenClickMap: true
                    });
                    aC.open(map, J.getPosition());
                });
                var bd = map.getBounds().getSouthWest();
                var bf = map.getBounds().getNorthEast();
                var a4 = bd.lat;
                var bb = bd.lng;
                var bg = bf.lat;
                var a7 = bf.lng;
                E = new AMap.Bounds([bb, a4], [a7, bg]);
            }
            var a5;
            for (var ba = 0; ba < g.length; ba++) {
                marker2 = new AMap.Marker({
                    position: [aS[ba], w[ba]],
                    map: map,
                    offset: new AMap.Pixel(-16, -13),
                    icon: new AMap.Icon({
                        size: new AMap.Size(40, 40),
                        image: "../../resources/img/stop.png",
                        imageOffset: new AMap.Pixel(0, 0)
                    })
                });
                var bc = parseInt(g[ba] / 1000);
                var a8 = 0;
                var a6 = 0;
                if (bc > 60) {
                    a8 = parseInt(bc / 60);
                    bc = parseInt(bc % 60);
                    if (a8 > 60) {
                        a6 = parseInt(a8 / 60);
                        a8 = parseInt(a8 % 60);
                    }
                }
                var bh = "" + parseInt(bc) + "秒";
                if (a8 > 0) {
                    bh = "" + parseInt(a8) + "分" + bh;
                }
                if (a6 > 0) {
                    bh = "" + parseInt(a6) + "小时" + bh;
                }
                var a9 = [];
                a9.push("停车点:" + ba);
                a9.push("停车时间:" + bh);
                a9.push("开始时间:" + S[ba]);
                a9.push("结束时间:" + j[ba]);
                marker2.content = a9.join("<br/>");
                marker2.on("click", trackPlayback.markerClick);
                marker2.setMap(map);
            }
            map.setFitView();
        }, markerStop: function (a4) {
            if (ab) {
                markerStops.setMap(null);
            }
            markerStops = new AMap.Marker({
                position: [(longtitudeStop2[a4 - 1]), (latitudeStop2[a4 - 1])],
                draggable: true,
                cursor: "move",
                icon: new AMap.Icon({
                    size: new AMap.Size(40, 40),
                    image: "../../resources/img/stop.png",
                    imageOffset: new AMap.Pixel(0, 0)
                })
            });
            markerStops.setMap(map);
            markerStops.setAnimation("AMAP_ANIMATION_BOUNCE");
            ab = true;
        }, markerClick: function (a4) {
            aU.setContent(a4.target.content);
            aU.open(map, a4.target.getPosition());
        }, showAddFencePage: function () {
            setTimeout(function () {
                aH("#addFencePage").modal("show");
            }, 200);
        }, startAnimation: function () {
            L = 0;
            aH("#playIcon").attr("class", "resultIcon playIcon");
            var a7 = map.getBounds().getSouthWest();
            var a6 = map.getBounds().getNorthEast();
            var a4 = a7.lat;
            var a8 = a7.lng;
            var a5 = a6.lat;
            var a9 = a6.lng;
            E = new AMap.Bounds([a8, a4], [a9, a5]);
            X = 0;
            e = 0;
            aL = 1;
            map.clearInfoWindow();
            aH("#GPSData .dataTables_scrollBody").scrollTop(0);
            aH("#gpsTable tbody tr").removeClass("tableSelected");
            aH("#gpsTable tbody tr:nth-child(1)").addClass("tableSelected");
            aH("#playIcon").attr({"data-toggle": "tooltip", "data-placement": "top", "data-original-title": "播放"});
            if (k != undefined) {
                k.restart();
            }
        }, FFAnimation: function () {
            H = true;
            map.clearInfoWindow();
            k.FF();
        }, retreatAnimation: function () {
            m = true;
            H = true;
            map.clearInfoWindow();
            if (aL <= 1) {
                layer.msg("已经是第一个点了");
            } else {
                k.retreat();
            }
        }, clears: function () {
            J, aK = [], E;
            k;
            aS = [];
            w = [];
            g = [];
            S = [];
            j = [];
            latitudeStop2 = [];
            longtitudeStop2 = [];
            X = 0;
            e = 0;
            n = 0;
            ao = false;
            aL = 1;
            T = 1;
            m = false;
            aI = [];
            ak = [];
            q = [];
            Z = [];
            aJ = [];
            aG = 1;
            aY = 1;
            K = 1;
            H = false;
            ap = [];
            am = [];
            V = [];
            aF = 0;
            r = 0;
            a0 = 0;
        }, query: function () {
            stopDataFlag = true;
            var a6 = false;
            var a4 = aH("#citySel").val();
            if (a4 == "" || a4 == undefined) {
                layer.msg("请选择车牌号！", {move: false});
                return false;
            }
            var a5 = parseInt(aH("#startTime").val().substring(0, 10).replace(/\-/g, ""));
            var a8 = parseInt(aH("#endTime").val().substring(0, 10).replace(/\-/g, ""));
            for (var a7 = 0; a7 < P.length; a7++) {
                if (parseInt(P[a7][0]) >= a5 && parseInt(P[a7][0]) <= a8) {
                    a6 = true;
                    playState = true;
                }
            }
            if (!a6) {
                layer.msg("该时间段无数据！", {move: false});
                a6 = false;
                playState = false;
                return false;
            }
            trackPlayback.clears();
            layer.load(2);
            map.clearMap();
            trackPlayback.getHistory();
            trackPlayback.trackMap();
        }, continueAnimation: function () {
            if (aH("#playIcon").hasClass("playIcon")) {
                if (playState) {
                    aH("#playIcon").attr("class", "resultIcon suspendedIcon");
                    k.move();
                    T = 0;
                    map.clearInfoWindow();
                    aH("#playIcon").removeAttr("data-original-title data-placement data-toggle");
                    aH("#playIcon").attr({
                        "data-toggle": "tooltip",
                        "data-placement": "top",
                        "data-original-title": "暂停"
                    });
                } else {
                    layer.msg("请先查询数据！", {move: false});
                }
            } else {
                aH("#playIcon").attr("class", "resultIcon playIcon");
                aH("#playIcon").removeAttr("data-original-title data-placement data-toggle");
                aH("#playIcon").attr({"data-toggle": "tooltip", "data-placement": "top", "data-original-title": "播放"});
                k.stop();
                T = 1;
                var a4 = [];
                a4.push("GPS时间：" + aI[aL - 1][2]);
                a4.push("在线状态：" + aI[aL - 1][4]);
                a4.push("ACC状态：" + aI[aL - 1][5]);
                a4.push("速度(km/h)：" + aI[aL - 1][6]);
                a4.push("方向：" + aI[aL - 1][7]);
                a4.push('<a type="button" id="addFence" onclick="trackPlayback.showAddFencePage()" style="cursor:pointer;display:block;margin: 8px 0px 0px 0px;" data-toggle="modal" data-target="#commonWin">轨迹生成路线</a>');
                content = a4;
                aC = new AMap.InfoWindow({
                    content: content.join("<br/>"),
                    offset: new AMap.Pixel(-20, -13),
                    closeWhenClickMap: true
                });
                aC.open(map, J.getPosition());
            }
        }, UnixToDate: function (a8, a6, a5) {
            if (typeof(a5) == "number") {
                a8 = parseInt(a8) + parseInt(a5) * 60 * 60;
            }
            var a7 = new Date(a8 * 1000);
            var a4 = "";
            a4 += a7.getUTCFullYear() + "-";
            a4 += (a7.getMonth() + 1) + "-";
            a4 += a7.getDate();
            if (a6 === true) {
                a4 += " " + a7.getHours() + ":";
                a4 += a7.getMinutes() + ":";
                a4 += a7.getSeconds();
            }
            return a4;
        }, getHistory: function (a8) {
            var a7 = a8;
            var a6 = aH("#savePid").attr("value");
            var a5 = aH("#startTime").val();
            var a4 = aH("#endTime").val();
            aH.ajax({
                type: "POST",
                url: "/clbs/v/monitoring/getHistoryData",
                data: {"vehicleId": a6, "startTime": a5, "endTime": a4},
                dataType: "json",
                async: true,
                beforeSend: function () {
                    layer.load(2);
                },
                success: function (bU) {
                    s = [];
                    aD = [];
                    layer.closeAll("loading");
                    aY = 1;
                    K = 1;
                    aG = 1;
                    if (bU.success) {
                        Z = [];
                        aI = [];
                        aJ = [];
                        q = [];
                        var bh;
                        var bd;
                        var bL = aH.parseJSON(bU.msg);
                        var bv = bL.stops;
                        for (var bR = 0; bR < bv.length; bR++) {
                            if (bv[bR].stopTime > 300000 && bv[bR].positional.latitude != 0 && bv[bR].positional.latitude != undefined) {
                                var bW = bv[bR].positional;
                                bh = bW.latitude;
                                bd = bW.longtitude;
                                g.push(bv[bR].stopTime);
                                aS.push(bd);
                                w.push(bh);
                                S.push(bv[bR].startTime);
                                j.push(bv[bR].endTime);
                            }
                        }
                        var bN = bL.resultful;
                        var bu = bN.length;
                        if (parseInt(bu) > 0) {
                            aH("#addFence").attr("disabled", false);
                        } else {
                            aH("#addFence").attr("disabled", true);
                        }
                        var bM;
                        var bD;
                        var ba;
                        var by;
                        var bc;
                        var bV;
                        var bt;
                        var bi = "";
                        var bq = 0;
                        var bQ = 0;
                        var bH;
                        var bj = bL.groups;
                        var bn = [];
                        index_lng_lat = 0;
                        for (var bS = 0; bS < bu; bS++) {
                            bM = bN[bS];
                            by = bM.status;
                            if (by.length == 32) {
                                by = by.substring(18, 19);
                            } else {
                                by = bM.status & 1;
                            }
                            bV = bM.speed / 10;
                            bh = bM.latitude;
                            bd = bM.longtitude;
                            var bx = trackPlayback.UnixToDate(bM.vtime, true);
                            index_lng_lat++;
                            if (bh != 0 && bd != 0) {
                                if (bh != 0 && bd != 0) {
                                    var bG = Math.abs(parseFloat(bq) - parseFloat(bh));
                                    var bz = Math.abs(parseFloat(bQ) - parseFloat(bd));
                                    if (bG < 0.000095 && bz < 0.000095) {
                                        bh = (parseFloat(bh) + 0.00015) + "";
                                        bd = (parseFloat(bd) + 0.00015) + "";
                                        bq = bh;
                                        bQ = bd;
                                    } else {
                                        bq = bh;
                                        bQ = bd;
                                    }
                                    aK.push([bd, bh]);
                                    ap.push(parseInt(bM.speed) / 10);
                                    am.push(bx);
                                    if (bM.gpsMile >= 0) {
                                        V.push(parseInt(bM.gpsMile) / 10);
                                    } else {
                                        V.push("0");
                                    }
                                }
                                bc = "在线行驶";
                            } else {
                                if (bh == 0 && bd == 0) {
                                    bc = "未定位";
                                } else {
                                    bc = "在线停车";
                                }
                            }
                            bt = bM.angle;
                            bi = "";
                            if ((0 <= bt && 22.5 >= bt) || (337.5 < bt && bt <= 360)) {
                                bi = "北";
                            } else {
                                if (22.5 < bt && 67.5 >= bt) {
                                    bi = "东北";
                                } else {
                                    if (67.5 < bt && 112.5 >= bt) {
                                        bi = "东";
                                    } else {
                                        if (112.5 < bt && 157.5 >= bt) {
                                            bi = "东南";
                                        } else {
                                            if (157.5 < bt && 202.5 >= bt) {
                                                bi = "南";
                                            } else {
                                                if (202.5 < bt && 247.5 >= bt) {
                                                    bi = "西南";
                                                } else {
                                                    if (247.5 < bt && 292.5 >= bt) {
                                                        bi = "西";
                                                    } else {
                                                        if (292.5 < bt && 337.5 >= bt) {
                                                            bi = "西北";
                                                        } else {
                                                            if (360 < bt) {
                                                                bi = "北";
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            var bf = bM.alarm;
                            if (bf != 0) {
                                var bO = "";
                                if ((bf & 1) != 0) {
                                    bO += "紧急报警,";
                                }
                                if ((bf & 2) != 0) {
                                    bO += "超速报警,";
                                }
                                if ((bf & 4) != 0) {
                                    bO += "疲劳驾驶,";
                                }
                                if ((bf & 8) != 0) {
                                    bO += "危险预警,";
                                }
                                if ((bf & 16) != 0) {
                                    bO += "GNSS模块发生故障,";
                                }
                                if ((bf & 32) != 0) {
                                    bO += "GNSS天线未接或被剪断,";
                                }
                                if ((bf & 64) != 0) {
                                    bO += "GNSS天线短路,";
                                }
                                if ((bf & 128) != 0) {
                                    bO += "终端主电源欠压,";
                                }
                                if ((bf & 256) != 0) {
                                    bO += "终端主电源掉电,";
                                }
                                if ((bf & 512) != 0) {
                                    bO += "终端LCD或显示器故障,";
                                }
                                if ((bf & 1024) != 0) {
                                    bO += "TTS模块故障,";
                                }
                                if ((bf & 2048) != 0) {
                                    bO += "摄像头故障,";
                                }
                                if ((bf & 4096) != 0) {
                                    bO += "道路运输证IC卡模块故障,";
                                }
                                if ((bf & 8192) != 0) {
                                    bO += "超速预警,";
                                }
                                if ((bf & 16384) != 0) {
                                    bO += "疲劳驾驶预警,";
                                }
                                if ((bf & 262144) != 0) {
                                    bO += "当天累计驾驶超时,";
                                }
                                if ((bf & 524288) != 0) {
                                    bO += "超时停车,";
                                }
                                if ((bf & 1048576) != 0) {
                                    bO += "进出区域,";
                                }
                                if ((bf & 2097152) != 0) {
                                    bO += "进出路线,";
                                }
                                if ((bf & 4194304) != 0) {
                                    bO += "路段行驶时间不足/过长,";
                                }
                                if ((bf & 8388608) != 0) {
                                    bO += "路线偏离报警,";
                                }
                                if ((bf & 16777216) != 0) {
                                    bO += "车辆VSS故障,";
                                }
                                if ((bf & 33554432) != 0) {
                                    bO += "车辆油量异常,";
                                }
                                if ((bf & 67108864) != 0) {
                                    bO += "车辆被盗,";
                                }
                                if ((bf & 134217728) != 0) {
                                    bO += "车辆非法点火,";
                                }
                                if ((bf & 268435456) != 0) {
                                    bO += "车辆非法位移,";
                                }
                                if ((bf & 536870912) != 0) {
                                    bO += "碰撞预警,";
                                }
                                if ((bf & 1073741824) != 0) {
                                    bO += "侧翻预警,";
                                }
                                if ((bf & 2147483648) != 0) {
                                    bO += "非法开门报警,";
                                }
                                if (bO != "") {
                                    bO = bO.substring(0, bO.length - 1);
                                }
                                bH = [aG, ""];
                                aG++;
                                Z.push(bH);
                            } else {
                                Z.push(undefined);
                            }
                            var bb = trackPlayback.formatDate(bx, "yyyy-MM-dd HH:mm:ss");
                            bD = [0, bM.plateNumber, bb, bj == undefined ? "未分组" : bj, bc, by == 0 ? "关" : "开", bV.toFixed(2), bi, bM.gpsMile > 0 ? (bM.gpsMile / 10).toFixed(1) : "0", (bM.satelliteNumber == undefined ? "0" : bM.satelliteNumber), bd, bh, "加载中..."];
                            if (bc == "在线行驶") {
                                bD[0] = aY++;
                                bn.push([bd, bh]);
                                aI.push(bD);
                            }
                            if (index_lng_lat == bu) {
                                console.log("近如");
                                var be = 0;
                                var bK = [];
                                setTimeout(function () {
                                    backAddressMsg1(be, bn, trackPlayback.goBackMsg, bK, "gpsTable", "13");
                                }, 100);
                            }
                        }
                        if (a7 != 0) {
                            aH("#allMileage").text((V[V.length - 1] - V[0]).toFixed(2) + "km");
                            var bm = am[0];
                            var bp = am[am.length - 1];
                            var bJ;
                            var bl;
                            if (bm == undefined || bp == undefined) {
                                bJ = 0;
                                bl = 0;
                            } else {
                                bJ = (new Date(bp.replace(/-/g, "/"))).getTime();
                                bl = (new Date(bm.replace(/-/g, "/"))).getTime();
                            }
                            var bT = (bJ - bl);
                            var a9 = parseInt(bT / 1000);
                            var bC = 0;
                            var bB = 0;
                            if (a9 > 60) {
                                bC = parseInt(a9 / 60);
                                a9 = parseInt(a9 % 60);
                                if (bC > 60) {
                                    bB = parseInt(bC / 60);
                                    bC = parseInt(bC % 60);
                                }
                            }
                            var bw = "" + parseInt(a9) + "秒";
                            if (bC > 0) {
                                bw = "" + parseInt(bC) + "分" + bw;
                            }
                            if (bB > 0) {
                                bw = "" + parseInt(bB) + "小时" + bw;
                            }
                            a0 = bw;
                            aH("#allTime").text(a0);
                            aH("#maxSpeend").text(Math.max.apply(Math, ap).toFixed(2) + "km/h");
                        }
                        var bP = bL.stop;
                        var bI = bP.length;
                        tableSetstop = [];
                        var bo = [];
                        var bF = 0;
                        N = bI;
                        for (var bS = 0; bS < bI; bS++) {
                            var bE = bP[bS];
                            var br;
                            var bg = bE.status & 1;
                            latitudeStop2.push(bE.latitude);
                            longtitudeStop2.push(bE.longtitude);
                            if (bE.latitude == 0 && bE.longtitude == 0) {
                                br = "未定位";
                            } else {
                                br = "在线停车";
                            }
                            stopangle = bE.angle;
                            stopdirection = "";
                            if ((0 <= stopangle && 22.5 >= stopangle) || (337.5 < stopangle && stopangle <= 360)) {
                                stopdirection = "北";
                            } else {
                                if (22.5 < stopangle && 67.5 >= stopangle) {
                                    stopdirection = "东北";
                                } else {
                                    if (67.5 < stopangle && 112.5 >= stopangle) {
                                        stopdirection = "东";
                                    } else {
                                        if (112.5 < stopangle && 157.5 >= stopangle) {
                                            stopdirection = "东南";
                                        } else {
                                            if (157.5 < stopangle && 202.5 >= stopangle) {
                                                stopdirection = "南";
                                            } else {
                                                if (202.5 < stopangle && 247.5 >= stopangle) {
                                                    stopdirection = "西南";
                                                } else {
                                                    if (247.5 < stopangle && 292.5 >= stopangle) {
                                                        stopdirection = "西";
                                                    } else {
                                                        if (292.5 < stopangle && 337.5 >= stopangle) {
                                                            stopdirection = "西北";
                                                        } else {
                                                            stopdirection = "未知数据";
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            if (a7 == 0) {
                                stopsatelliteNumber = 0;
                            } else {
                                if (bM != undefined) {
                                    stopsatelliteNumber = bM.satelliteNumber;
                                    if (bE.satelliteNumber == undefined || bE.satelliteNumber == 0) {
                                        stopsatelliteNumber = 0;
                                    }
                                } else {
                                    stopsatelliteNumber = 0;
                                }
                            }
                            var bs = trackPlayback.UnixToDate(bE.vtime, true);
                            var bA = trackPlayback.formatDate(bs, "yyyy-MM-dd HH:mm:ss");
                            ba = [0, bE.plateNumber, bA, bj == undefined ? "未分组" : bj, br, bg == 0 ? "关" : "开", stopdirection, bE.gpsMile > 0 ? (bE.gpsMile / 10).toFixed(1) : "0", stopsatelliteNumber, bP[bS].longtitude, bP[bS].latitude, "加载中..."];
                            ba[0] = K++;
                            bF++;
                            if (bP[bS].longtitude != "0.0" && bP[bS].latitude != "0.0") {
                                bo.push([bP[bS].longtitude, bP[bS].latitude]);
                            } else {
                                bo.push(["124.411991", "29.043817"]);
                            }
                            if (bF == bI) {
                                var bk = 0;
                                var bX = [];
                                var bK = [];
                                setTimeout(function () {
                                    backAddressMsg1(bk, bo, trackPlayback.goBackStopMag, bX, "gpsTable2", "12");
                                }, 200);
                            }
                            tableSetstop.push(ba);
                        }
                    }
                    setTimeout(function () {
                        trackPlayback.getTable("#gpsTable", aI);
                        trackPlayback.getTable("#gpsTable2", tableSetstop);
                        aH("#MapContainer").css({"height": (ax - 200) + "px"});
                        var bY = aH("#myTab").width();
                        var bZ = ((bY - 17) / bY) * 100;
                        aH(".dataTables_scrollHead").css("width", bZ + "%");
                        aH("#dragDIV").mousedown(function (b0) {
                            av = aH(".trackPlaybackTable .dataTables_scrollBody").height();
                            af = aH("#MapContainer").height();
                            at = b0.clientY;
                            aH(document).bind("mousemove", trackPlayback.mouseMove).bind("mouseup", trackPlayback.mouseUp);
                            b0.stopPropagation();
                        });
                        aH("#gpsTable tbody tr").bind("click", function () {
                            I = aH(this).children("td:nth-child(11)").text();
                            Q = aH(this).children("td:nth-child(12)").text();
                            var b0 = parseInt(aH(this).children("td:nth-child(1)").text());
                            X = b0 - 1;
                            n = b0 - 1;
                            if (b0 >= 4) {
                                e = b0 - 4;
                            } else {
                                e = 0;
                            }
                            a2 = true;
                            k.skip();
                        });
                        aH("#playCarListIcon").show();
                        aH("#scalingBtn").unbind().bind("click", function () {
                            if (aH(this).hasClass("fa-chevron-down")) {
                                ac = aH("#MapContainer").height();
                                A = aH(".trackPlaybackTable .dataTables_scrollBody").height();
                                aH(this).attr("class", "fa  fa-chevron-up");
                                var b0 = ay - a1 - y - Y - 20;
                                aH("#MapContainer").css({"height": b0 + "px"});
                                aH(".trackPlaybackTable .dataTables_scrollBody").css({"height": "0px"});
                            } else {
                                aH(this).attr("class", "fa  fa-chevron-down");
                                aH("#MapContainer").css({"height": ac + "px"});
                                aH(".trackPlaybackTable .dataTables_scrollBody").css({"height": A + "px"});
                            }
                        });
                        trackPlayback.trackMap();
                        trackPlayback.startAnimation();
                    }, 30);
                }
            });
        }, formatDate: function (a5, ba) {
            if (!a5) {
                return;
            }
            var a9 = a5.split(" ");
            var a7 = (a9[0].split("-"))[1] < 10 ? "0" + (a9[0].split("-"))[1] : (a9[0].split("-"))[1];
            var a8 = (a9[0].split("-"))[2] < 10 ? "0" + (a9[0].split("-"))[2] : (a9[0].split("-"))[2];
            var a4 = (a9[1].split(":"))[0] < 10 ? "0" + (a9[1].split(":"))[0] : (a9[1].split(":"))[0];
            var a6 = (a9[1].split(":"))[1] < 10 ? "0" + (a9[1].split(":"))[1] : (a9[1].split(":"))[1];
            var bb = (a9[1].split(":"))[2] < 10 ? "0" + (a9[1].split(":"))[2] : (a9[1].split(":"))[2];
            return (a9[0].split("-"))[0] + "-" + a7 + "-" + a8 + " " + a4 + ":" + a6 + ":" + bb;
        }, getActiveDate: function (a6, a4, a7) {
            var a5 = a4.split("-")[0] + a4.split("-")[1];
            aH.ajax({
                type: "POST",
                url: "/clbs/v/monitoring/getActiveDate",
                data: {"vehicleId": a6, "nowMonth": a4, "nextMonth": a7},
                dataType: "json",
                async: true,
                beforeSend: function () {
                    layer.load(2);
                },
                success: function (bc) {
                    layer.closeAll("loading");
                    P = [];
                    aa = [];
                    if (bc.success) {
                        var ba = aH.parseJSON(bc.msg);
                        var bf = ba.date;
                        var be = ba.dailyMile;
                        for (var bd = 0; bd < bf.length; bd++) {
                            var bb = a5 + (parseInt(bf[bd] + 1) < 10 ? "0" + parseInt(bf[bd] + 1) : parseInt(bf[bd] + 1));
                            P.push([bb, bb, (be[bd] / 10).toFixed(1)]);
                        }
                    }
                    var bg = aH("#treeDemo").height();
                    var a9 = aH(".calendar3 tbody tr").length;
                    aH(".calendar3").html("");
                    aH(".calendar3").calendar({highlightRange: P, stopHighlightRange: aa});
                    var a8 = aH(".calendar3 tbody tr").length;
                    if (a8 > a9) {
                        aH("#treeDemo").css("height", (bg - 34) + "px");
                    } else {
                        if (a8 < a9) {
                            aH("#treeDemo").css("height", (bg + 54) + "px");
                        }
                    }
                    aH(".calendar3 tbody td").each(function () {
                        if (aH(this).hasClass("widget-disabled")) {
                            aH(this).removeClass("widget-highlight").removeClass("widget-stopHighlight");
                            aH(this).children("span").children("span.mileageList").text("-");
                        }
                    });
                    isFlag = false;
                }
            });
        }, getTable: function (a4, a5) {
            a4 = aH(a4).DataTable({
                "destroy": true,
                "dom": "itprl",
                "scrollX": true,
                "scrollY": 198,
                "data": a5,
                "lengthChange": false,
                "bPaginate": false,
                "bFilter": false,
                "searching": false,
                "ordering": false,
                "info": false,
                "autoWidth": false,
                "stripeClasses": [],
                "oLanguage": {
                    "oAria": {
                        "sSortAscending": " - click/return to sort ascending",
                        "sSortDescending": " - click/return to sort descending"
                    },
                    "sLengthMenu": "显示 _MENU_ 记录",
                    "sInfo": "当前显示 _START_ 到 _END_ 条，共 _TOTAL_ 条记录。",
                    "sZeroRecords": "没有查到您要找的数据，请再次确认一下您的查询条件吧",
                    "sEmptyTable": "未有相关数据",
                    "sLoadingRecords": "正在加载数据-请等待...",
                    "sInfoEmpty": "当前显示0到0条，共0条记录",
                    "sInfoFiltered": "（数据库中共为 _MAX_ 条记录）",
                    "sProcessing": "<img src='../resources/user_share/row_details/select2-spinner.gif'/> 正在加载数据...",
                    "sSearch": "模糊查询：",
                    "sUrl": "",
                    "oPaginate": {"sFirst": "首页", "sPrevious": " 上一页 ", "sNext": " 下一页 ", "sLast": " 尾页 "}
                },
                "order": [[0, null]],
            });
            a4.on("order.dt search.dt", function () {
                a4.column(0, {search: "applied", order: "applied"}).nodes().each(function (a6, a7) {
                    a6.innerHTML = a7 + 1;
                });
            }).draw();
        }, tableStopData: function () {
            setTimeout(function () {
                aH("#stopData .dataTables_scrollBody").scrollTop(0);
            }, 200);
            if (stopDataFlag) {
                setTimeout(function () {
                    aH("#gpsTable2 tbody tr").bind("click", function () {
                        aH("#gpsTable2 tbody tr").removeClass("tableSelected");
                        aH(this).addClass("tableSelected");
                        var a4 = parseInt(aH(this).children("td:nth-child(1)").text());
                        trackPlayback.markerStop(a4);
                    });
                }, 200);
                stopDataFlag = false;
            }
        }, ajaxDataFilter: function (a7, a4, a6) {
            if (a6) {
                for (var a5 = 0; a5 < a6.length; a5++) {
                    if (a6[a5].iconSkin != "assignmentSkin") {
                        a6[a5].open = true;
                    }
                }
            }
            return a6;
        }, zTreeBeforeClick: function () {
            return true;
        }, zTreeOnClick: function (a4, bb, bc) {
            ar = aq.getFullYear() + "-" + (parseInt(aq.getMonth() + 1) < 10 ? "0" + parseInt(aq.getMonth() + 1) : parseInt(aq.getMonth() + 1)) + "-01";
            ah = aq.getFullYear() + "-" + (parseInt(aq.getMonth() + 2) < 10 ? "0" + parseInt(aq.getMonth() + 2) : parseInt(aq.getMonth() + 2)) + "-01";
            if (bc.iconSkin == "vehicleSkin") {
                var a7 = bc.id;
                aH("#savePid").attr("value", a7);
                var a5 = bc.name;
                aH("#citySel").val(a5);
                var a8 = aH.fn.zTree.getZTreeObj("treeDemo");
                var a6 = a8.getCheckedNodes(true);
                for (var ba = 0, a9 = a6.length; ba < a9; ba++) {
                    a8.checkNode(a6[ba], false, true);
                }
                a8.selectNode(bc, false, true);
                a8.checkNode(bc, true, true);
                trackPlayback.getActiveDate(a7, ar, ah);
            }
        }, zTreeBeforeCheck: function (a8, a7) {
            var a6 = aH.fn.zTree.getZTreeObj("treeDemo");
            var a4 = a6.getCheckedNodes(true);
            for (var a5 = 0; a5 < a4.length; a5++) {
                a6.checkNode(a4[a5], false, true);
            }
        }, zTreeOnAsyncSuccess: function (a4, a9, bb, a6) {
            var a5 = aH("#vid").val();
            if (a5 != "") {
                var a7 = aH.fn.zTree.getZTreeObj("treeDemo");
                var bc = a7.getNodes();
                var a8 = a7.getNodesByParam("id", a5, null);
                a7.checkNode(a8[0], true, true);
                var ba = aH("#citySel");
                ba.val(a8[0].name);
                trackPlayback.getActiveDate(a5, ar, ah);
            }
        }, onCheck: function (ba, a8, a7) {
            ar = aq.getFullYear() + "-" + (parseInt(aq.getMonth() + 1) < 10 ? "0" + parseInt(aq.getMonth() + 1) : parseInt(aq.getMonth() + 1)) + "-01";
            ah = aq.getFullYear() + "-" + (parseInt(aq.getMonth() + 2) < 10 ? "0" + parseInt(aq.getMonth() + 2) : parseInt(aq.getMonth() + 2)) + "-01";
            var a6 = aH.fn.zTree.getZTreeObj("treeDemo"), a5 = a6.getCheckedNodes(true), a4 = "";
            var bb = a5[0].id;
            a6.selectNode(a7, false, true);
            aH("#savePid").attr("value", bb);
            a4 = a5[0].name;
            var a9 = aH("#citySel");
            a9.val(a4);
            aH("#menuContent").hide();
            trackPlayback.getActiveDate(bb, ar, ah);
        }, showMenu: function () {
            var a4 = aH("#citySel");
            aH("#menuContent").css({left: 15 + "px", top: a4.outerHeight() + "px"}).slideDown("fast");
            aH("body").bind("mousedown", trackPlayback.onBodyDown);
        }, hideMenu: function () {
            aH("#menuContent").fadeOut("fast");
            aH("body").unbind("mousedown", trackPlayback.onBodyDown);
        }, onBodyDown: function (a4) {
            if (!(a4.target.id == "menuBtn" || a4.target.id == "citySel" || a4.target.id == "menuContent" || aH(a4.target).parents("#menuContent").length > 0)) {
                trackPlayback.hideMenu();
            }
        }, goHidden: function () {
            if (aH("#scalingBtn").hasClass("fa-chevron-down")) {
                ac = aH("#MapContainer").height();
                A = aH(".trackPlaybackTable .dataTables_scrollBody").height();
                aH("#scalingBtn").attr("class", "fa fa-chevron-up");
            }
            aH("#content-left").hide();
            aH("#content-right").attr("class", "col-md-12 content-right");
            aH("#content-right").css("width", "100%");
            aH("#goShow").show();
            aH("#MapContainer").css({"height": (initialMapH - 5) + "px"});
            aH(".trackPlaybackTable .dataTables_scrollBody").css({"height": 0 + "px"});
        }, goShow: function () {
            aH("#scalingBtn").attr("class", "fa fa-chevron-down");
            if (aH(".dataTables_scrollBody").length == 0) {
                aH("#MapContainer").css({"height": initialMapH + "px"});
                aH(".trackPlaybackTable .dataTables_scrollBody").css({"height": 0 + "px"});
            } else {
                aH("#MapContainer").css({"height": ac + "px"});
                aH(".trackPlaybackTable .dataTables_scrollBody").css({"height": A + "px"});
            }
            aH("#content-left").show();
            aH("#content-right").attr("class", "col-md-9 content-right");
            if (aH(".sidebar").hasClass("sidebar-toggle")) {
                aH("#content-right").css({"width": 100 - au + "%"});
                aH("#content-left").css({"width": au + "%"});
            } else {
                aH("#content-right").css({"width": "75%"});
                aH("#content-left").css({"width": "25%"});
            }
            aH("#goShow").hide();
        }, getHistory1: function () {
            var a7 = "";
            var a5 = "";
            var a6 = "";
            var a9 = aH("#savePid").val();
            var a8 = aH("#startTime").val();
            var a4 = aH("#endTime").val();
            aH.ajax({
                type: "POST",
                url: "/clbs/v/monitoring/getHistoryData",
                data: {"vehicleId": a9, "startTime": a8, "endTime": a4},
                dataType: "json",
                async: false,
                success: function (bf) {
                    if (bf.success) {
                        var bd = aH.parseJSON(bf.msg);
                        var bb = bd.resultful;
                        var bh = bb.length;
                        var bg;
                        var bi;
                        var ba;
                        var bc = 0;
                        for (var be = 0; be < bh; be++) {
                            bg = bb[be];
                            bi = bg.latitude;
                            ba = bg.longtitude;
                            a7 += (bc++) + ",";
                            a5 += Math.formatFloat(ba, 6) + ",";
                            a6 += Math.formatFloat(bi, 6) + ",";
                        }
                        if (a7.length > 0) {
                            a7 = a7.substr(0, a7.length - 1);
                        }
                        if (a5.length > 0) {
                            a5 = a5.substr(0, a5.length - 1);
                        }
                        if (a6.length > 0) {
                            a6 = a6.substr(0, a6.length - 1);
                        }
                        aH("#pointSeqs").val(a7);
                        aH("#longitudes").val(a5);
                        aH("#latitudes").val(a6);
                    }
                }
            });
        }, doSubmits1: function () {
            if (trackPlayback.validate_line()) {
                aH("#addFenceBtn").attr("disabled", true);
                aH("#hideDialog").attr("disabled", true);
                trackPlayback.getHistory1();
                var a6 = aH("#pointSeqs").val();
                var a4 = aH("#longitudes").val();
                var a5 = aH("#latitudes").val();
                if (a6 == "" || a4 == "" || a5 == "") {
                    layer.msg("未找到历史轨迹数据！");
                    return;
                }
                layer.load(2);
                aH("#addLineForm").ajaxSubmit(function () {
                    layer.msg("保存成功");
                    aH(".cancle").click();
                    aH("#addFenceBtn").attr("disabled", false);
                    aH("#hideDialog").attr("disabled", false);
                    aH("#hideDialog").click();
                    layer.closeAll();
                });
            }
        }, validate_line: function () {
            return aH("#addLineForm").validate({
                rules: {
                    name: {required: true, maxlength: 20},
                    width: {required: true, maxlength: 10},
                    description: {maxlength: 100}
                },
                messages: {
                    name: {required: "不能为空", maxlength: "长度不超过20"},
                    width: {required: "不能为空", maxlength: "长度不超过10"},
                    description: {maxlength: "长度不超过100"}
                }
            }).form();
        }, hideDialog: function () {
            aH(".modal-backdrop").hide();
            aH("#commonWin").hide();
            trackPlayback.clearErrorMsg();
            trackPlayback.clearLine();
        }, clearErrorMsg: function () {
            aH("label.error").hide();
            aH(".error").removeClass("error");
        }, clearLine: function () {
            aH("#addOrUpdateLineFlag").val("0");
            aH("#lineId").val("");
            aH("#lineName1").val("");
            aH("#lineWidth1").val("");
            aH("#lineDescription1").val("");
            aH("#pointSeqs").val("");
            aH("#longitudes").val("");
            aH("#latitudes").val("");
        }, toolClickList: function () {
            if (d != null) {
                b.close(true);
                map.remove(d);
            }
            b.rectangle();
        }, createSuccess: function (a5) {
            a = a5.obj.getBounds();
            aZ = aH("#startTime").val();
            R = aH("#endTime").val();
            aw = aH("#savePid").val();
            aZ = new Date(Date.parse(aZ.replace(/-/g, "/")));
            aZ = aZ.getTime() / 1000;
            R = new Date(Date.parse(R.replace(/-/g, "/")));
            R = R.getTime() / 1000;
            F = a.getSouthWest().getLng();
            al = a.getSouthWest().getLat();
            c = a.getNorthEast().getLng();
            D = a.getNorthEast().getLat();
            var a4 = "/clbs/v/monitoring/getHistoryByTimeAndAddress";
            var a5 = {
                "leftTopLongitude": F,
                "leftTopLatitude": al,
                "rightFloorLongitude": c,
                "rightFloorLatitude": D,
                "vehicleId": aw,
                "startTime": aZ,
                "endTime": R
            };
            ajax_submit("POST", a4, "json", true, a5, true, trackPlayback.regionalQuery);
        }, regionalQuery: function (ba) {
            var bc = 0;
            var bb = "";
            var a5 = ba.msg;
            var a9 = JSON.parse(a5);
            var be = false;
            if (a9 != null) {
                var bd = a9.vehicleInfos;
                if (bd.length > 0) {
                    be = true;
                    var a8 = [];
                    a8.push("开始时间:" + aH("#startTime").val());
                    a8.push("结束时间:" + aH("#endTime").val());
                    a8.push("该区域经过的监控对象:");
                    var bf = "turnoverId";
                    for (i = 0; i < bd.length; i++) {
                        bc++;
                        bf = bf + "_" + i;
                        var a6 = bd[i].vehicleId;
                        var a4 = bd[i].carLicense;
                        var a7 = bd[i].assignmentName;
                        bb += '<tr data-id="' + a6 + '" class="fenceTurnoverTime"><td>' + a4 + "</td><td>" + a7 + '</td></tr><tr><td class="areaSearchTable" colspan="2"><table class="table table-striped table-bordered" cellspacing="0" width="100%"><thead><tr><th>序号</th><th>进区域时间</th><th>出区域时间</th></tr></thead><tbody id="' + bf + '"></tbody></table></td></tr>';
                        a8.push(a4);
                    }
                    d = new AMap.Marker({
                        map: map,
                        position: a.getCenter(),
                        offset: new AMap.Pixel(-26, -13),
                        content: '<div class="marker-route marker-marker-bus-from">' + bc + "</div>",
                        zIndex: 99999,
                        autoRotation: true
                    });
                    d.content = a8.join("<br/>");
                    d.on("click", trackPlayback.markerClickRegionalQuery);
                }
            }
            aH("#areaSearchCarStartTime").text(aH("#startTime").val());
            aH("#areaSearchCarEndTime").text(aH("#endTime").val());
            aH("#dataTable tbody.monitoringObj").html(bb);
            aH(".fenceTurnoverTime").unbind("click").bind("click", trackPlayback.fenceTurnoverTime);
            if (be) {
                aH("#areaSearchCar").modal("show");
                b.close(false);
            } else {
                layer.msg("该区域没有任何监控对象");
                b.close(true);
            }
        }, searchCarClose: function () {
            aH("#areaSearchCar").modal("hide");
        }, markerClickRegionalQuery: function (a4) {
            aQ.setContent(a4.target.content);
            aQ.open(map, a4.target.getPosition());
        }, fenceTurnoverTime: function () {
            aw = aH(this).attr("data-id");
            var a4 = "/clbs/v/monitoring/getQueryDetails";
            aT = aH(this).next("tr").children("td").children("table").children("tbody").attr("id");
            if (aH("#" + aT).html() == "") {
                var a5 = {
                    "leftTopLongitude": F,
                    "leftTopLatitude": al,
                    "rightFloorLongitude": c,
                    "rightFloorLatitude": D,
                    "vehicleId": aw,
                    "startTime": aZ,
                    "endTime": R
                };
                ajax_submit("POST", a4, "json", true, a5, true, trackPlayback.searchTurnoverValue);
            } else {
                var a6 = aH("#" + aT).parents("td.areaSearchTable");
                if (a6.is(":hidden")) {
                    a6.slideDown(200);
                } else {
                    a6.slideUp(200);
                }
            }
        }, searchTurnoverValue: function (a6) {
            if (a6.success) {
                var a5 = "";
                var a8 = a6.obj;
                for (var a4 = 0; a4 < a8.length; a4++) {
                    if (a8[a4][0] != "") {
                        var a7 = trackPlayback.turnTimeFormat(a8[a4][0]);
                        a5 += "<tr><td>" + (a4 + 1) + "</td><td>" + a7 + "</td>";
                    } else {
                        a5 += "<tr><td>" + (a4 + 1) + "</td><td>未进区域</td>";
                    }
                    if (a8[a4][1] != "") {
                        var a7 = trackPlayback.turnTimeFormat(a8[a4][1]);
                        a5 += "<td>" + a7 + "</td></tr>";
                    } else {
                        a5 += "<td>未出区域</td></tr>";
                    }
                }
                aH("#" + aT).html(a5);
                aH("#" + aT).parents("td.areaSearchTable").slideDown(200);
            }
        }, getLocalTime: function (a4) {
            return new Date(parseInt(a4) * 1000).toLocaleString().substr(0, 17);
        }, turnTimeFormat: function (a6) {
            var bb;
            var a7 = new Date(a6 * 1000);
            var a5 = a7.getFullYear() + "-";
            var ba = (a7.getMonth() + 1 < 10 ? "0" + (a7.getMonth() + 1) : a7.getMonth() + 1) + "-";
            var a4 = (a7.getDate() < 10 ? "0" + a7.getDate() : a7.getDate()) + " ";
            var a9 = (a7.getHours() < 10 ? "0" + a7.getHours() : a7.getHours()) + ":";
            var a8 = (a7.getMinutes() < 10 ? "0" + a7.getMinutes() : a7.getMinutes()) + ":";
            var bc = (a7.getSeconds() < 10 ? "0" + a7.getSeconds() : a7.getSeconds());
            bb = a5 + ba + a4 + a9 + a8 + bc;
            return bb;
        }, alarmData: function () {
            var a6 = aH("#citySel").val();
            z = aH("#startTime").val();
            aR = aH("#endTime").val();
            var a8 = new Date(Date.parse(z.replace(/-/g, "/"))) / 1000;
            var a4 = new Date(Date.parse(aR.replace(/-/g, "/"))) / 1000;
            var a5 = "/clbs/v/monitoring/getAlarmData";
            trackPlayback.getTable("#gpsTable3", []);
            var a7 = {"vehicleId": a6, "startTime": a8, "endTime": a4,};
            setTimeout(function () {
                ajax_submit("POST", a5, "json", true, a7, true, trackPlayback.alarmDatatable);
            }, 60);
        }, alarmDatatable: function (bp) {
            var a4 = bp.obj;
            var bi;
            var bj = 1;
            var bn = [];
            var a7 = null;
            var bg = "";
            var bc = 0;
            var bd = null;
            for (var bk = 0; bk < a4.length; bk++) {
                var a5 = a4[bk];
                var ba = a5.plateNumber;
                var a9 = a5.assignmentName;
                var bq = a5.description;
                var be = a5.status;
                var bf = a5.personName;
                var a8 = a5.startTime;
                var bo = a5.startLocation;
                var bh = a5.endTime;
                var bb = a5.endLocation;
                bi = [0, ba, a9 == undefined ? "未分组" : a9, bq, be, bf, a8, bo, bh, bb];
                bi[0] = bj;
                bj++;
                bn.push(bi);
                if (a7 == null || a7 != a8) {
                    a7 = a8;
                    bg = "";
                    bg = bq;
                    if (bd != null) {
                        var bl = [];
                        bl.push("监控对象:" + bd[1]);
                        bl.push("所属用户:" + bd[2]);
                        bl.push("报警信息:" + bd[3]);
                        bl.push("处理状态:" + bd[4]);
                        bl.push("处理人:" + bd[5]);
                        bl.push("报警开始时间:" + bd[6]);
                        bl.push("报警开始位置:" + bd[7]);
                        bl.push("报警结束时间:" + bd[8]);
                        bl.push("报警结束位置:" + bd[9]);
                        var a6 = new AMap.Marker({
                            map: map,
                            position: bd[0],
                            icon: "../../resources/img/al.png",
                            zIndex: 9999,
                            autoRotation: true
                        });
                        a6.content = bl.join("<br/>");
                        a6.on("click", trackPlayback.markeralarmDatatable);
                    }
                    var bm = a5.alarmStartLocation.split(",");
                    bd = [];
                    bd.push([bm[0], bm[1]]);
                    bd.push(ba);
                    bd.push(a9);
                    bd.push(bg);
                    bd.push(be);
                    bd.push(bf === null ? "无" : bf);
                    bd.push(a8);
                    bd.push(bo);
                    bd.push(bh);
                    bd.push(bb);
                    bc = 1;
                } else {
                    bg = bg + "," + bq;
                    var bm = a5.alarmStartLocation.split(",");
                    bd = [];
                    bd.push([bm[0], bm[1]]);
                    bd.push(ba);
                    bd.push(a9);
                    bd.push(bg);
                    bd.push(be);
                    bd.push(bf === null ? "无" : bf);
                    bd.push(a8);
                    bd.push(bo);
                    bd.push(bh);
                    bd.push(bb);
                    bc++;
                }
            }
            trackPlayback.getTable("#gpsTable3", bn);
        }, markeralarmDatatable: function (a4) {
            aP.setContent(a4.target.content);
            aP.open(map, a4.target.getPosition());
        },
    };
    aH(function () {
        var a7;
        var a6 = false;
        var a5 = true;
        isFlag = false;
        trackPlayback.init();
        h.maxValue = 40000;
        h.Initialize();
        B.maxValue = 100;
        aH("#toggle-left").on("click", trackPlayback.toggleBtn);
        aH("#realTimeBtn .mapBtn").on("click", trackPlayback.mapBtnActive);
        aH("#realTimeRC").on("click", trackPlayback.realTimeRC);
        aH("#query").on("click", trackPlayback.query);
        aH("#tableStopData").on("click", trackPlayback.tableStopData);
        aH("#citySel").bind("input oninput", function () {
            search_ztree("treeDemo", "citySel", "vehicle");
        });
        aH("input").inputClear().on("onClearEvent", function (a9, a8) {
            var ba = a8.id;
            if (ba == "citySel") {
                search_ztree("treeDemo", ba, "vehicle");
            }
        });
        if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.split(";")[1].replace(/[ ]/g, "") == "MSIE9.0") {
            var a4;
            aH("#citySel").bind("focus", function () {
                a4 = setInterval(function () {
                    search_ztree("treeDemo", "citySel", "vehicle");
                }, 500);
            }).bind("blur", function () {
                clearInterval(a4);
            });
        }
        aH("#goRealTime").mouseover(function () {
            aH(this).css({"color": "#6dcff6"}).children("a").css("color", "#6dcff6");
        }).mouseout(function () {
            aH(this).css({"color": "#767676"}).children("a").css("color", "#767676");
        });
        aH("#goHidden").on("click", trackPlayback.goHidden);
        aH("#goShow").on("click", trackPlayback.goShow);
        aH("#setMap").on("click", trackPlayback.satelliteMapSwitching);
        aH("#retreatAnimation").on("click", trackPlayback.retreatAnimation);
        aH("#playIcon").on("click", trackPlayback.continueAnimation);
        aH("#startAnimation").on("click", trackPlayback.startAnimation);
        aH("#FFAnimation").on("click", trackPlayback.FFAnimation);
        aH("#addFenceBtn").on("click", trackPlayback.doSubmits1);
        aH("#hideDialog").on("click", trackPlayback.hideDialog);
        aH("#searchCarClose").on("click", trackPlayback.searchCarClose);
        aH("#specialTimePlayBack").on("click", trackPlayback.toolClickList);
    });
})($, window);